<template>
  <d-config-provider>
    <div>
      <d-directory-tree @expand="onExpand">
        <d-tree-node key="0-0" title="parent 0">
          <d-tree-node key="0-0-0" title="leaf 0-0" is-leaf />
          <d-tree-node key="0-0-1" title="leaf 0-1" is-leaf />
        </d-tree-node>
        <d-tree-node key="0-1" title="parent 1">
          <d-tree-node key="0-1-0" title="leaf 1-0" is-leaf />
          <d-tree-node key="0-1-1" title="leaf 1-1" is-leaf />
        </d-tree-node>
      </d-directory-tree>

      <d-directory-tree showIcon @expand="onExpand">
        <d-tree-node key="0-0" title="parent 0">
          <template v-slot:icon>
            <d-icon type="appstore" />
          </template>
        </d-tree-node>
      </d-directory-tree>
    </div>
  </d-config-provider>
</template>

<script>
export default {
  methods: {
    onExpand() {
      console.log('Trigger Expand');
    }
  }
};
</script>

<style lang="scss" scoped></style>
